# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: jimmy-6
pkgname=libnoise
pkgver=1.0.0
pkgrel=6
pkgdesc="A portable, open-source, coherent noise-generating library for C++"
arch=('loong64' 'x86_64')
url="http://libnoise.sourceforge.net/"
license=('LGPL')
makedepends=('cmake' 'unzip')
source=("https://prdownloads.sourceforge.net/libnoise/libnoisesrc-${pkgver}.zip"
        "CMakeLists.txt")
noextract=("libnoisesrc-${pkgver}.zip")
sha512sums=('02fd600ad60d668d230ecc9d2f34020c0e3b8d1365c9ec78ae795c7031224fc2624080764824a4f899571d848587578c80a70e879b22463774435f16c3d06529'
            '2aff377667962bcc1b7af7e4957af112be2c8837df6a5010b6bfc243a62e100f3b10f7fec8de1021d269521f77d490c6f71b4db0ba392c04df2b438bc13b789b')

build() {
  cd ${srcdir}
  unzip "libnoisesrc-${pkgver}.zip"
  cp 'CMakeLists.txt' 'noise'
  mkdir build
  cd build
  cmake ../noise \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_SKIP_RPATH=ON
  make
}

package() {
  cd ${srcdir}/build
  make DESTDIR=${pkgdir} install
}
